#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "user_interface.h"
#include "pwm.h"
#include "user_devicefind.h"
#include "user_webserver.h"
#include "ip_addr.h" 
#include "ra_timer.h"

#include <ra_wifi.h>
#include <ra_device_state.h>
#include <ra_utils.h>
#include <cJSON.h>
/*
#include "json.h"
#include "jsonparse.h"
#include "jsontree.h"*/
#include <ra_parameter.h>
#include "string.h"
#include "stdio.h"
#include "user_key.h"


ra_timer_t timer_key_led; 

FUN_ATTRIBUTE
void ctl_LED_KEY()
{
   scan_Key();
   
   ra_timer_start(timer_key_led, 10, ra_false);
}



FUN_ATTRIBUTE	
void Init()
{
	InitKey();
	InitLed();
    InitUserWifi();	
}

FUN_ATTRIBUTE
void ra_user_main(void)
{
   os_printf("devloop 20161015\n");
   Init();

   ra_timer_new(&timer_key_led);
   ra_timer_set_callback(timer_key_led, ctl_LED_KEY, NULL);  
   ra_timer_start(timer_key_led, 10, ra_false);
}


 
